package com.example.travel.domain.response;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.travel.domain.entity.Comment;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @Author : LinQingLiang
 * @file : Comment.java
 * @Since : 2023/2/15 18:05
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("comments")
@ApiModel(value = "评论实体类")
public class CommentAndUserResponse {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("评论内容")
    private String content;

    @ApiModelProperty("评论人id")
    private Integer userId;

    @ApiModelProperty("评论时间")
    private String time;

    @ApiModelProperty("父id")
    private Integer pid;

    @ApiModelProperty("父节点的用户昵称")
    private String pNickName;

    @ApiModelProperty("父节点的用户id")
    private Integer pUserId;

    @ApiModelProperty("最上级id")
    private Integer originId;

    @ApiModelProperty("关联文章id")
    private Integer articleId;

    @ApiModelProperty("用户昵称")
    private String nickName;

    @ApiModelProperty("用户头像")
    private String avatarUrl;

    private List<CommentAndUserResponse> children;

}
